const Mock = require("mockjs");
const Random = Mock.Random;
/*
* 需求：requirementApi
* */
Mock.mock("/backend/behavior/req/list", {
    success: true,
    value: {
        "list|1-10": [
            {
                "id|+1": 1,
                "requirementId|+1": 1,
                "requirementName": "@name",
                "requirementType|1-4": 1,
                "bizName": "@name",
                "version": 1.1,
                "sdkType|1-3": 1,
                "appId": Random.integer(),
                "appName": "@name",
                "testAddress": Random.url(),
                "officialAddress": Random.url(),
                "status": Random.integer(1, 6),
                "creatorName": "@name",
                "createTime": Random.now(),
                "updateTime": Random.now(),
            }
        ],
        /*"list": [
            {
                id: 1,
                requirementId: 10001,
                requirementName: "欢go"
            }
        ],*/
        "total": 100
    }
});
Mock.mock("/backend/behavior/req/sync-list", {
    success: true,
    value: {
        "list|1-10": [
            {
                "id|+1": 1,
                "requirementId|+1": 1,
                "requirementName": "@name",
                "requirementType|1-4": 1,
                "bizName": "@name",
                "version": 1.1,
                "sdkType|1-3": 1,
                "appId": Random.integer(),
                "appName": "@name",
                "testAddress": Random.url(),
                "officialAddress": Random.url(),
                "status": Random.integer(1, 50),
                "creatorName": "@name",
                "createTime": Random.now(),
                "updateTime": Random.now(),
            }
        ],
        "total": 100
    }
});
Mock.mock("/backend/behavior/req/query", {
    success: true,
    value: {
        "id|+1": 1,
        "requirementId|+1": 1,
        "requirementName": "@name",
        "requirementType|1-4": 1,
        "appId": Random.integer(1, 10),
        "bizId": Random.integer(1, 10),
        "bizName": "@name",
        "version": 1.1,
        "sdkType|1-3": 1,
        "appName": "@name",
        "status": 2,
        "extMessage": Random.string(),
        "creatorName": "@name",
        "createTime": Random.now(),
        "updateTime": Random.now(),
    }
})
/*
* 位置：pageApi
* */
// 列表
Mock.mock("/backend/behavior/page/list", {
    success: true,
    value: {
        "list|1-10": [
            {
                "id|+1": 1,
                "pageId|+1": 1,
                "pageName": "@name",
                "pageType": Random.integer(1, 3),
                "subType": Random.integer(1, 6),
                "subTypeValue": Random.string(1, 10),
                "pageUrl": Random.string(),
                "imageUrl": Random.dataImage(),
                "requirementType": Random.integer(0, 4),
                "version": 1.2,
                "subEventNum": "10/5/3",
                "parentId": Random.integer(1, 10),
                "level": 1,
                "hasChildren": true
            }
        ],
    "total": 100
    }
});

/*
* 埋点：eventApi
* */
// 列表
Mock.mock("/backend/behavior/event/list", {
    success: true,
    value: {
        "list|1-10": [
            {
                "id|+1": 1,
                "eventId|+1": 1,
                "trackName": "@name",
                "eventId|1-6": 1,
                "eventName": "@name",
                "actionEffectName": "@name",
                "actionTypeName": "@name",
                "extMessage": {
                    "actionEffect|1-6": 1,
                    "actionType|1-6": 1,
                    "trackOpportunity": "@name"
                },
                "bizName": "@name",
                "version": 1.1,
                "demoCode": Random.string(),
                "requirementType|1-4": 1,
                "processStatus|0-1": 0,
                "status": Random.integer(1, 6),
                "dataStatus": Random.integer(1, 6),
                "hitCount": Random.integer(1, 1000),
                "userCount": Random.integer(1, 1000),
                "fieldAttributes|1-5": [
                    {
                        "id|+1": 1,
                        "propertyType|1-10": 1,
                        "propertyId|+1": 1,
                        "propertyName": "@name",
                        "dataType": "string",
                        "explain": Random.string(1, 10),
                        "remark": Random.string(1, 10)
                    }
                ],
                "pageDO": {
                    "pageName": "@name",
                    "pageId|+1": 1,
                    "pageType": Random.integer(1, 3),
                    "subType": Random.integer(1, 6),
                    "pageUrl": Random.dataImage(),
                }
            }
        ],
        "total": 100
    }
});
Mock.mock("/backend/behavior/event/query", {
    success: true,
    value: {
        "id|+1": 1,
        "trackId|+1": 1,
        "trackName": "@name",
        "eventId|1-6": 1,
        "eventName": "@name",
        "actionEffectName": "@name",
        "actionTypeName": "@name",
        // "extMessage": {
        //     "actionEffect|1-6": 1,
        //     "actionType|1-6": 1,
        //     "eventOpportunity": "@name"
        // },
        "extMessage": null,
        "bizName": "@name",
        "version": 1.1,
        "demoCode": Random.string(),
        "requirementType|1-4": 1,
        "processStatus|0-1": 0,
        "status": Random.integer(1, 6),
        "dataStatus": Random.integer(1, 6),
        "hitCount": Random.integer(1, 1000),
        "userCount": Random.integer(1, 1000),
        "fieldAttributes|1-5": [
            {
                "id|+1": 1,
                "category": "@name",
                "propertyType|1-10": 1,
                "propertyId|+1": 1,
                "propertyName": "@name",
                "dataType": "string",
                "explain": Random.string(1, 10),
                "remark": Random.string(1, 10)
            }
        ],
        "pageDO": {
            "pageName": "@name",
            "pageId|+1": 1,
            "pageType": Random.integer(1, 3),
            "subType": Random.integer(1, 6),
            "pageUrl": Random.dataImage(),
        }
    }
})
/*
* 应用：app
* */
Mock.mock("/application_mwq/backend/behavior/app/list", {
    success: true,
    value: {
        "list|1-100": [
            {
                "id|+1": 1,
                "appId|+1": 1,
                "appName": "@name",
                "appType|1-6": 1,
                "bizId|+1": 1,
                "bizName": "@name",
            }
        ],
        "total": 100
    }
});

/*
* 栏目：biz
* */
Mock.mock("/application_mwq/backend/behavior/biz/list", {
    success: true,
    value: {
        "list|1-100": [
            {
                "id|+1": 1,
                "bizId|+1": 1,
                "bizName": "@name",
            }
        ],
        "total": 100
    }
});

/*
* 元数据：机构
* */
Mock.mock("/application_mwq/backend/behavior/metadata/query", {
    success: true,
    value: {
        data: {
            1: "集团",
            2: "山西"
        }
    }
});

/*
* 事件类型：eventType
* */
Mock.mock("/application_mwq/backend/behavior/event-type/list", {
    success: true,
    value: {
        "list|1-100": [
            {
                "id|+1": 1,
                "eventId|+1": 1,
                "eventName": "@name",
                "actionType|+1": 1,
                "actionEffect|+1": 1,
            }
        ],
        total: 100
    }
});

/*
* 事件属性：eventProperty
* */
Mock.mock("/application_mwq/backend/behavior/event-property/list", {
    success: true,
    value: {
        "list|1-100": [
            {
                "id|+1": 1,
                "propertyId|+1": 1,
                "category": "@name",
                "propertyName": "@name",
                "extMessage": "@name",
                "remark": "@name",
                "propertyType|+1": 1,
                "dataType|+1": 1,
            }
        ],
        total: 100
    }
});
